<?php
include('db.php');
function login($username,$password){
  $conn=getConn();
  $sql="select * from admin where username='".$username."'";
  $result=mysqli_query($conn,$sql);
  while ($row = mysqli_fetch_array($result, MYSQLI_ASSOC)) {
      if($row['password']==$password){
        Session_start();
        $_SESSION['username']=$username;
        $_SESSION['userId']=$row['id'];
        $_SESSION['loginFlag']=true;
        return true;
      }else{
        return false;
      }
  }
}


?>